import {defineStore} from 'pinia'
export const  useUserStore = defineStore({
 id:'user',
 state:()=>{
return {
  token:'',
  userInfo:[]
}},

actions: {
    setToken(token) {
      console.log('传入了token');
      
      this.token = token
    },
    //开启数据缓存
    persist: {
      enabled: true,
      strategies: [
        {
          key: 'luxian_user',
          storage: localStorage,
          // paths: ['token', 'userInfo']
        }
      ]
    }

  }

})